package lion.crawl.parse;

/**
 * @author Helin
 * @date 2012-8-19
 * @email hl_0074@sina.com
 * @desc
 */
public class URLRule {

	private String pattern;
	private boolean parse;

	public URLRule(String pattern, boolean parse) {

		super();
		this.pattern = pattern;
		this.parse = parse;
	}

	public boolean needParse(String url) {

		return this.parse && url.matches(this.pattern);
	}

	public boolean matches(String url) {

		return url.matches(this.pattern);
	}
}
